package com.lishui.waterfriend.service;

import com.lishui.waterfriend.common.result.PageResult;
import com.lishui.waterfriend.pojo.dto.PageDTO;
import com.lishui.waterfriend.pojo.dto.UserRegisterDTO;
import com.lishui.waterfriend.pojo.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lishui.waterfriend.pojo.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 用户服务
 */
public interface UserService extends IService<User> {

    /**
     * 用户注册
     */
    long userRegister(UserRegisterDTO userRegisterDTO);

    /**
     * 用户登录
     *
     * @param userAccount  用户账户
     * @param userPassword 用户密码
     * @param request
     * @return 脱敏后的用户信息
     */
    UserVO userLogin(String userAccount, String userPassword, HttpServletRequest request);

    /**
     * 用户脱敏
     *
     * @param originUser
     * @return
     */
    // User getSafetyUser(User originUser);

    /**
     * 用户注销
     *
     * @param request
     * @return
     */
    void userLogout(HttpServletRequest request);

    List<UserVO> searchUsers(String username);

    PageResult searchUserByTagListSql(List<String> tagList, Integer pageNum, Integer pageSize);

    List<UserVO> searchUserByTagListMemory(List<String> tagList);

    boolean isAdmin();

    void update(User user);


    PageResult PageQueryRecommendUser(Integer pageNum, Integer pageSize);

    boolean removeUserById(long id);

    PageResult PageQueryMatchUser(PageDTO pageDTO);

    UserVO getCurrentUser();
}
